const jsr = require("jsrsasign")

let privateKey = "-----BEGIN PRIVATE KEY-----MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAM4qwaCwXLudDHDmQLgivPhPzOhJV+FBoz9gXErlB3ykWVxsN9ntc6C5rB9UoKBtLPPwvaEE0J9zB8R0imBawF+IRJtZvaDnBIzEZntRSt4ia6VW7H36Eu8QQ7h3FqpmE/GbvF0vIsB6BD9rL4Fle14JiEq6nZSGMik0A0kPkFqjAgMBAAECgYAKAo1wLd/yxAdMnAFcb2NZcxZx2M3JhBRXCWixwjkA1kH4eNClZiANF7bBtqwt3d8m4PN0E/XFKCKiaT4mu4FHi9kfErbhg0NT88bZRT/+G41L90gtxYRqLMRpCRADA48bEZVa0/d/Lq9m1RF7r7oRaIxovZfgbPPu8HAe4HQhcQJBAOXZ1jTbqnwk4gQS5BF/yJxVILsuLweYsyW90HvjxAIkDYw6tnzkgoWG3Z2F2csBg58iOcFJuca2OqH2n45Ki70CQQDlnyaqcAYDgUdiSyO2Himsbmk1PDZaaDzJVF0AbKijKcQlWwA2zYQYUxpS3eNc3n0Kg5Gyo/vT4+KiNzI6ZLXfAkEAzPlyeTjb1FHf7Nob4S8fa6rOwZ3x+shGGoYnghQgG/iizEcfrkjpzMH0qCFRlCQJiMQw1Ro2PesMZptUtsPr0QJBAIOALYiWNxtywgrMtVrq0zro0F+oaAhGgela4xgHIlyu4qHyB6Fa+TdlAEJMyJS65ilLR/liaCnk7DmyGpXOb0kCQQDa3PxIuTvWZkev7OLtzhBWxYSrW9SAJgH2ig7cHNoaubIy0Ws0pOyqN1k19W9azOA7HE/9hDZUQaqD5Mtt86HC-----END PRIVATE KEY-----"
let publicKey = "-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOKsGgsFy7nQxw5kC4Irz4T8zoSVfhQaM/YFxK5Qd8pFlcbDfZ7XOguawfVKCgbSzz8L2hBNCfcwfEdIpgWsBfiESbWb2g5wSMxGZ7UUreImulVux9+hLvEEO4dxaqZhPxm7xdLyLAegQ/ay+BZXteCYhKup2UhjIpNANJD5BaowIDAQAB-----END PUBLIC KEY-----"

let hashAlg = "SHA256withRSA"

let sig = new jsr.KJUR.crypto.Signature({alg: hashAlg})
sig.init(privateKey)
sig.updateString("aaa")
let sigHex = sig.sign()

console.log(sigHex)